package com.smit.icast;

import android.content.Context;

import com.smit.adapter.DVBAdapter;
import com.smit.adapter.DVBDeviceManager;
import com.smit.utils.LogUtil;

/**
 * iCask SDK初始化类
 *
 * @author visual zhang
 * @version 0.0.1
 */
public class ICastInitializer {
    private static final String TAG = "ICastInitializer";

    /**
     * 获取icast初始化对象
     *
     * @return icast初始化对象
     */
    public static ICastInitializer getInstance() {
        return SingletonHolder.instance;
    }

    /**
     * 初始化iCast SDK
     *
     * @param context Android application context
     * @param appID 分配给合作开发的应用ID
     * @param appKey 分配给合作开发的应用Key
     */
    public void initializeICast(Context context, String appID, String appKey) {
        LogUtil.info(TAG, "initializeICast start>>>");
        DVBAdapter.getInstance().initialize(context, appID, appKey);
        DVBAdapter.getInstance().getDVBDeviceManager().setDeviceType(DVBDeviceManager.DVB_DEVICE_ICAST);
        LogUtil.info(TAG, "initializeICast end<<<");
    }

    private static class SingletonHolder {
        private static ICastInitializer instance = new ICastInitializer();
    }
}